controlWindowInsetsAnimation

open fun controlWindowInsetsAnimation(types: Int, durationMillis: Long, @Nullable interpolator: Interpolator, @Nullable cancellationSignal: CancellationSignal, @NonNull listener: WindowInsetsAnimationControlListenerCompat)(source)

Lets the application control window inset animations in a frame-by-frame manner by modifying the position of the windows in the system causing insets directly using setInsetsAndAlpha in the controller provided by the given listener.

This method only works on API >= 30 since there is no way to control the window in the system on prior APIs.

Parameters

types

The WindowInsetsCompat.Types the application has requested to control.

durationMillis

Duration of animation in MILLISECONDS, or -1 if the animation doesn't have a predetermined duration. This value will be passed to getDurationMillis

interpolator

The interpolator used for this animation, or null if this animation doesn't follow an interpolation curve. This value will be passed to getInterpolator and used to calculate getInterpolatedFraction.

cancellationSignal

A cancellation signal that the caller can use to cancel the request to obtain control, or once they have control, to cancel the control.

listener

The WindowInsetsAnimationControlListener that gets called when the windows are ready to be controlled, among other callbacks.

See also